﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace WCS.Infrastructure.EFCore;

/// <summary>
/// 系统用户表
/// </summary>
[Table("Sys_User")]
[Index("Phone", Name = "Sys_User_Phone_idx", IsUnique = true)]
public partial class SysUser
{
    /// <summary>
    /// 用户Id
    /// </summary>
    [Key]
    [StringLength(32)]
    public string Id { get; set; } = null!;

    /// <summary>
    /// 用户名
    /// </summary>
    [StringLength(255)]
    public string? Name { get; set; }

    /// <summary>
    /// 手机号
    /// </summary>
    [StringLength(11)]
    public string Phone { get; set; } = null!;

    /// <summary>
    /// 密码
    /// </summary>
    [StringLength(64)]
    public string? Password { get; set; }

    /// <summary>
    /// 邮箱
    /// </summary>
    [StringLength(255)]
    public string? Email { get; set; }

    /// <summary>
    /// 用户头像URL
    /// </summary>
    [StringLength(255)]
    public string? AvatarUrl { get; set; }

    /// <summary>
    /// 用户状态：0=禁用，1=启用
    /// </summary>
    public int EnableStatus { get; set; }

    /// <summary>
    /// 用户最后登录时间
    /// </summary>
    [Column(TypeName = "timestamp(6) without time zone")]
    public DateTime? LastLoginTime { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Column(TypeName = "timestamp(6) without time zone")]
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 账户余额，单位为分
    /// </summary>
    public long? Balance { get; set; }

    /// <summary>
    /// 冻结余额，单位为分
    /// </summary>
    public long? BlockedBalance { get; set; }

    /// <summary>
    /// 可提现余额，单位为分
    /// </summary>
    public long? WithdrawableBalance { get; set; }

    /// <summary>
    /// 未结算余额，单位为分
    /// </summary>
    public long? UnsettledBalance { get; set; }

    /// <summary>
    /// 待分账余额，单位为分
    /// </summary>
    public long? DividedBalance { get; set; }

    /// <summary>
    /// 用户选择商户团队成员ID
    /// </summary>
    [StringLength(32)]
    public string? CurrentUserRoleId { get; set; }
}
